fix sorting waypoints