   attachLocationChangeListener: =>
     if @pushStateSupport
       @addListener window, "popstate", (event) =>
-        href = window.location.pathname
-        @log("Rendering onpopstate", href)
-        @renderUrl(href)
+        if @clickCount > 0
+          href = window.location.pathname
+          @log("Rendering popstate", href)
+          @renderUrl(href)
     else
       if @hashchangeSupport
         @addListener window, "hashchange", (event) =>
           if window.location.hash.substring(0, 2) == "#!"
             href = window.location.hash.substring(2)
-            if !@previous || href != @previous.path
-              @log("Rendering onhashchange", href)
-              @renderUrl(href)
+            @log("Rendering hashchange", href)
+            @renderUrl(href)
 
   renderInitialView: =>
     @log("Rendering initial page")

  exec: (path) =>
    if matched = @find(path)
      @log("Found route for", path, " Calling function with params ", matched.params)
      matched.result = matched.fn(matched.params)
      for listener in @postExecutionListeners
        listener(matched, @previous)
      @previous = matched
      return matched
  find: (path) =>

        return {params: params, route: candidate.matchedRoute, fn: candidate.fn, urlPattern: candidate.urlPattern, path: path, metadata: candidate.metadata}
  addPostExecutionListener: (fn) =>
    @postExecutionListeners.push(fn)
  addExceptionListener: (fn) =>
    @exceptionListeners.push(fn)

  pushStateSupport: history && history.pushState
  hashchangeSupport: "onhashchange" of window
