changed how isGoalState works