         // first time setup pages
         setupPages()
         
-        // first time
+        
+        // first time set defaule pageIndex
         if (!isStarted) {
-            // set defaule pageIndex
             pageIndex = defaultPage
-            
             isStarted = true
+        } else {
+            
+            pageIndex = prevPageIndex
         }
         
         // load pages

            if (numberOfPages != 0) {
                var tabOffsetX = 0 as CGFloat
                var contentOffsetX = 0 as CGFloat
                for (var i = 0; i < index; i++) {
                    tabOffsetX += widthForTabAtIndex(index)
                    contentOffsetX += self.frame.width
                }
                // set default position of tabs and contents
                tabSectionScrollView.contentOffset = CGPoint(x: tabOffsetX + tabSectionScrollView.contentInset.left * -1, y: tabSectionScrollView.contentOffset.y)
                contentSectionScrollView.contentOffset = CGPoint(x: contentOffsetX  + contentSectionScrollView.contentInset.left * -1, y: contentSectionScrollView.contentOffset.y)
                
                updateTabAppearance()
            }
            prevPageIndex = index
        }

        super.init(frame: frame)
    }
    
    override public func layoutSubviews() {
        super.layoutSubviews()
        
        // set custom attrs
        tabSectionScrollView.backgroundColor = tabSectionBackgroundColor
        contentSectionScrollView.backgroundColor = contentSectionBackgroundColor
