             let height = (self.scrollDirection == .Horizontal) ? self.pageSize.height : CGFloat(self.numberOfViews)*self.pageSize.height
             self.scrollView.contentSize = CGSize(width: width, height: height)
             self.viewControllers = Array(repeating: nil, count: self.numberOfViews)
+            self.views = Array(repeating: nil, count: self.numberOfViews)
 
 
             let x = (self.infinite == true && self.scrollDirection == .Horizontal) ? self.pageSize.width : 0

        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)


    fileprivate func cleanArray() {
        for i in 0..<self.viewControllers.count {
            if let vc = self.viewControllers[i], let view = self.views[i] {
                view.removeFromSuperview()
                vc.view.removeFromSuperview()
                vc.removeFromParentViewController()
                self.viewControllers[i] = nil
                self.views[i] = nil
            }
        }
    }

    fileprivate func clearSlot(index : Int) {
        if let vc = self.viewControllers[index], let view = self.views[index] {
            vc.view.removeFromSuperview()
            vc.removeFromParentViewController()
            if self.isLazy == true {
                self.viewControllers[index] = nil
                self.views[index] = nil
            }
        }
    }
