     $.ajax(squats_url).success (squats) ->
       window.squats = squats
       addSquat squat for squat in squats
-      openSquatFromHash()
+      hashchange()
 
   $('#geocode').click (e) ->
     e.preventDefault()

      opening_popup = true
      popup.openOn map
      opening_popup = false

$(->
  map.on "popupclose", (e) ->

popup = L.popup()

opening_popup = false
hashchange = ->
  slug = document.location.hash.replace '#', ''
  if slug.length == 0
    map.closePopup()
