         }
     }
 
+    // used to store view controllers
+    fileprivate var viewControllers : [UIViewController?] = []
     // used to store views
-    fileprivate var viewControllers : [UIViewController?] = []
+    fileprivate var views : [UIView?] = []
 
     fileprivate var targetContentOffset : CGPoint?
 

        let height = (self.scrollDirection == .Horizontal) ? self.pageSize.height : CGFloat(self.numberOfViews)*self.pageSize.height
        self.scrollView.contentSize = CGSize(width: width, height: height)

        for vc in self.viewControllers {
            if let vc = vc {
                let index : Int = vc.view.tag
                let x : CGFloat = (self.scrollDirection == .Horizontal) ? CGFloat(index)*self.pageSize.width : 0.0
                let y : CGFloat = (self.scrollDirection == .Horizontal) ? 0.0 : CGFloat(index)*self.pageSize.height
                vc.view.frame = CGRect(x: x, y: y, width: self.pageSize.width, height: self.pageSize.height)
            }
        }
        self.setCurrentPage(newValue: self.currentIndex, animated: false)

        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
        self.viewControllers.removeAll()
        self.views.removeAll()
    }

    // MARK: - SCROLLVIEWDELEGATE
