extend the last waypoint line.
fix a bug.