 window.SammyApp = Sammy 'body', (n) ->
   @bind 'run-route', (e, data) ->
     VM.clearErrorMessage()
+    VM.cleanBuild()
     mixpanel.track_pageview(data.path)
     if window._gaq? # we dont use ga in test mode
       window._gaq.push data.path

          "&filters%5B0%5D%5Bcomparison%5D=contains&filters%5B0%5D%5Bvalue%5D=" +
          path[1]

  refreshBuildState: () =>
    VM.loadProjects()
    VM.current_page().refresh()

    @build_has_been_loaded(false)
    project_name = "#{username}/#{project}"
    @maybeLoadProjectDetails(project_name)
    @cleanBuild()
    $.getJSON "/api/v1/project/#{project_name}/#{build_num}", (data) =>
      @build(new CI.inner.Build data)
      @build_has_been_loaded(true)
