pathfinding bug fix