         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
+        for view in self.views {
+            if let view = view {
+                let index : Int = 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)
+                view.frame = CGRect(x: x, y: y, width: self.pageSize.width, height: self.pageSize.height)
             }
         }
         self.setCurrentPage(newValue: self.currentIndex, animated: false)

        }
    }

    // used to store views
    fileprivate var viewControllers : [UIViewController?] = []

    fileprivate var targetContentOffset : CGPoint?


        let y : CGFloat = (self.scrollDirection == .Horizontal) ? 0.0 : CGFloat(index)*self.pageSize.height
        // TODO: fix the fact that i need a view to not loose bg color ?
        let view = UIView(frame: CGRect(x: x, y: y, width: self.pageSize.width, height: self.pageSize.height))
        view.tag = index
        view.addSubview(vc.view)

        self.scrollView.addSubview(view)
        self.views[index] = view
        self.viewControllers[index] = vc
        vc.didMove(toParentViewController: self)
    }
