diff --git a/week2/solution/agent_programs.py b/week2/solution/agent_programs.py
index b53fd00f696e8c62e31822b81fbed3eb5d687029..049aa6393ff909062cc44cf9a2a6af4bd5fafbac 100644
--- a/week2/solution/agent_programs.py
+++ b/week2/solution/agent_programs.py
@@ -250,7 +250,7 @@ def utility_function(model, cur_location, direction):
             break
     
     # check if there is dirt in that direction
-    for cell in cells:
+    for cell in filtered_cells:
         if cell == 'D':
             # there is dirt, return high utility
             return 999