Finally fixed everything with pathfinding