         $page[0].offsetHeight # force relow
         setTimeout ->
           $target = $('#' + url.hash)
+          return unless $target.length > 0
           targetOffset = $target.offset()
           $(document).scrollTop(targetOffset.top - 30)
             .scrollLeft(targetOffset.left - 30)

  setCache: (page) ->
    unless page
      $page = @el.children().first()
      page = 
        url: @url.toString('relative')
        name: $page.data('page-name') || @pageTitle()
        html: @el.html()

      url = simple.url $link.attr 'href'

      if url
        @load url,
          nocache: $link.is '[data-pjax-nocache]'
          norefresh: $link.is '[data-pjax-norefresh]'

