fix pathfinding