     else
       if @hashchangeSupport
         window.onhashchange = (event) =>
-          href = window.location.hash.substring(2)
-          @log("Rendering onhashchange", href)
-          @renderUrl(href)
+          if window.location.hash.substring(0, 2) == "#!"
+            href = window.location.hash.substring(2)
+            if href != @hashPreviousView
+              @log("Rendering onhashchange", href)
+              @renderUrl(href)
 
   renderInitialView: =>
     @log("Rendering initial page")

            event.preventDefault();
            @updateUrl(href)
        else
          if @find(href)
            @log("Updating hash with", href)
            event.preventDefault();
            @updateUrl(href)

  attachLocationChangeListener: =>

# - copy build configs from bacon.js
# - split to own repository
# - more complete sinatra path parsing, JavascriptRouteParser
# - test suite
# Known issues:
# - hashbang urls don't work in a href tags -> won't fix, use /plain/urls
# - does not resolve situation hashbang url needs to be converted and both window.location.pathname and window.location.hash are defined
