PATHFINDING: fixed bug