Fix the goal state compare bug