move waypoint selection to waypoints directive