Fixing is_goal_state method