         # Manually set the mode to avoid confusion (wrong highlight).
         # Scrolling will obviously break it but that's unfortunate result
         # from having the scrollspy marker at middle of page.
-        @setState mode: mode, =>
+        @_setMode mode, =>
           # Doesn't work:
           # - part of state (callback, part of mode setting)
           # - simple variable in callback

      pageTop = page.getBoundingClientRect().top
      continue unless pageTop <= anchorHeight

      @setState mode: page.getAttribute('id')
      return

    @setState mode: page.getAttribute('id')


  _modeSwitch: (_e, mode) =>

    anchorHeight = window.innerHeight * 0.5

    if osu.bottomPage()
      @_setMode _.last(pages).id
      return

    # FIXME: I don't remember why this one scans from bottom while
