try fix bug of "Ad as last waypoint" code