 
   # remove all itineraries from the map
   remove_itineraries: =>
+    for view in @views if @views?
+      view?.clean_up(true) 
+      view.remove()
     @$('#itineraries').html('')
-    view?.clean_up(true) for view in @views if @views?
 
   go_to_splash: (event) =>
     # TODO: Place this to the topbar.

    @map = Transit.map
    @map.on 'drag:end', @drag_plan

    @model.on 'geocode geolocate fetch', @fetch_plan
    @model.on 'geocode:error', @geocode_error
    @model.on 'plan:timeout', @timeout_warn
    Transit.events.on 'geocode:fail', @geocode_fail

    # set the model from/to locations from the marker positions
    @model.set
      from: @map.get('from').position.toHash()
      to: @map.get('to').position.toHash(),
    { silent: true }
    # update the url and history with new locations
    from_url = @map.get('from').position.toUrlValue()
    to_url = @map.get('to').position.toUrlValue()
    # update the URL but don't trigger, purely cosmetic :)
    Transit.router.navigate "plan/#{from_url}/#{to_url}"
    # then load the new plan by hand
    @fetch_plan()

  # updates plan from geocode fail form
  update_plan: (evt) ->
    evt.preventDefault()
    # update endpoints using form or URL params (from router)
    from = $('#from_query').val() or Transit.unescape @options.from
    to = $('#to_query').val() or Transit.unescape @options.to
    # navigate to new plan URL and trigger reload
    @remove_itineraries()
    @remove()
    Transit.router.navigate "plan/#{from}/#{to}", true

    # @fetch_plan()

  fetch_plan: =>
    @render()
