                 print("***** API results *****")
                 
                 if IsHTTPStatus(statusCode: response.response?.statusCode) {
-                    self.movies.removeAll()
+                    self.isNext = obj["next"].boolValue
+                    self.isUpdating = false
                     
                     for data in obj["results"].arrayValue {
                         self.movies.append(MovieCompare().GetData(json: data))
                     }
                     
-                    self.InitCollectionView()
+                    self.collectionView.reloadData()
                 }else {
                     ShowStandardAlert(title: "Error", msg: obj.arrayValue[0].stringValue, vc: self)
                 }

        let keychain = Keychain()
        user_id = Int((try! keychain.get("id"))!)!
        
        CallGetCompareAPI()
    }
    

        
        return cell
    }
    
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        if scrollView.contentOffset.x + scrollView.frame.size.width > scrollView.contentSize.width && scrollView.isDragging && !isUpdating {
            if isNext {
                page_id += 1
                isUpdating = true
                CallGetCompareAPI()
            }
        }
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
