             updateTabAppearance()
         }
         
-        if (isStarted && prevScrollingIndex != pageIndex) {
+        let currentIndex = properPageIndex()
+        if (isStarted && pageIndex != currentIndex) {
+            // set index
+            pageIndex = currentIndex
+            
             // lazy loading
             lazyLoadPages()
             
-            prevScrollingIndex = pageIndex
             // callback
-            delegate?.tabScrollView(self, didScrollPageTo: pageIndex)
+            delegate?.tabScrollView(self, didScrollPageTo: currentIndex)
         }
     }
     

            self.setupPages()
            
            // first time set defaule pageIndex
            self.pageIndex = self.prevScrollingIndex ?? self.prevPageIndex ?? self.defaultPage
            self.isStarted = true
            
            // load pages

    
    private func updateTabAppearance(animated animated: Bool = true) {
        if (tabGradient) {
            if (numberOfPages != 0) {
                for i in 0 ..< numberOfPages {
                    var alpha: CGFloat = 1.0
                    
                    let offset = abs(i - pageIndex)
                    if (offset > 1) {
                        alpha = 0.2
                    } else if (offset > 0) {
