             }
         }
     }
+    
+    private class func update(cloudItemResult: Result<URLItemType>, withRealmItemID realmID: String) -> Result<URLItemType> {
+        // since cloud results don't have a real realm ID, we need to add the realm realm ID before returning it to the app
+        switch cloudItemResult {
+        case .success(var cloudItem):
+            cloudItem.realmID = realmID
+            return .success(cloudItem)
+        case .error:
+            return cloudItemResult
+        }
+    }
 }

            case .success(let realmValue):
                // if realm is successful, continue to cloud controller
                self.cloudKitController.createItem(withID: realmValue.cloudKitID) { cloudCreateResult in
                    switch cloudCreateResult {
                    case .success(var cloudValue):
                        cloudValue.realmID = realmValue.realmID
                        fullResult?(.success(cloudValue))
                    case .error:
                        fullResult?(cloudCreateResult)
                    }
                }
            }
        }

                fullResult?(realmResult)
            case .success(let updatedItem):
                // if realm is successful, continue to cloud controller
                self.cloudKitController.update(item: updatedItem) { cloudUpdateResult in
                    let updatedResult = type(of: self).update(cloudItemResult: cloudUpdateResult, withRealmItemID: item.realmID)
                    fullResult?(updatedResult)
                }
            }
        }
    }
