         let position = currentPagingViewPosition()
         
         // set new page number according to current moving direction
-        let previousPage: Int
+        let nextPage: Int
         switch position {
-        case .Left:
-            previousPage = currentPage
-            currentPage = previousIndex
-        case .Right:
-            previousPage = currentPage
-            currentPage = nextIndex
+        case .Left: nextPage = previousIndex
+        case .Right: nextPage = nextIndex
         default: return
         }
         
         let previousViewController = currentViewController
-        currentViewController = pagingViewControllers[currentPage]
-        if currentPage != previousPage {
-            delegate?.willMoveToPageMenuController?(currentViewController, previousMenuController: previousViewController)
-        }
+        currentViewController = pagingViewControllers[nextPage]
+        delegate?.willMoveToPageMenuController?(currentViewController, previousMenuController: previousViewController)
+        
+        currentPage = nextPage
         menuView.moveToMenu(page: currentPage, animated: true)
         contentScrollView.contentOffset.x = currentViewController.view!.frame.minX
 

        view.layoutIfNeeded()

        currentPosition = currentPagingViewPosition()
        if currentPage != previousPage {
            delegate?.didMoveToPageMenuController?(currentViewController, previousMenuController: previousViewController)
        }
    }
    
    // MARK: - UIGestureRecognizer

                self!.view.layoutIfNeeded()
                
                self!.currentPosition = self!.currentPagingViewPosition()
                self!.delegate?.didMoveToPageMenuController?(self!.currentViewController, previousMenuController: previousViewController)
        }
    }
    
