 
     # Get the last view in the stack, push the new view and activate it.
     pushView: (view) ->
-      prevView = @stack.slice(-1)[0]
+      prevView = @stack[@stack.length - 1]
       @stack.push(view)
       @activateCurrentView(prevView, true)
 


      nextView.show?(options)

      prevView = @stack.slice(-1)[0]

      # Assume we're pushing if the new view is already in the stack.
      push = @stack.indexOf(nextView) < 0

    # Perform two transitions synchronously. Get the next view, and get it
    # ready to animate. Remove events from the old view.
    activateCurrentView: (prevView, isPush) ->
      nextView = @stack[@stack.length - 1]

      if @preventPush
        nextView.delegateEvents().$el.show()
