another isGoalState method created to avoid downcasting