check valid mouse position before pathfinding
formatting