fixed a bug in the planner