fix js bug related to waypoints not returning