pathfinder code bugfix