bugfix: errors in the waypoint search

the waypoint search caused errors in newly added waypoints