fixed some pathfinding problems