fix bug in pathfinder