                             #if DEBUG
                                 CNLLog("Model removed items: \(deleted.count)", level: .debug)
                             #endif
-                            
+                            deletedItems = deleted
                             self.list = self.list.filter { item in !deleted.contains(item.primaryKey) }
                         }
                     }

    public func indexOf(item: ArrayElement) -> Int? {
        return self.list.index { return $0.primaryKey == item.primaryKey }
    }
    
    public func update(success: @escaping CNLModelCompletion, failed: @escaping CNLModelFailed) {
        if let localAPI = createAPI() {
            CNLModelNetworkProvider?.performRequest(
                api: localAPI,
                success: { apiObject in
                    if let data = self.preprocessData(apiObject.answerJSON) {
                        if let created = self.createdItems(data) {
                            #if DEBUG

                                if let index = self.indexOf(item: modifiedItem) {
                                    modifiedItem.states = self.list[index].states
                                    self.list[index] = modifiedItem
                                    modifiedItems.append(modifiedItem)
                                    return
                                }
                                createdItems.append(modifiedItem)
                                self.list.append(modifiedItem)
                            }
                            
