         
         /// Turns the `instance` into a ghost. It will not be saved again.
         public func ghost(_ instance: BaseModel) {
-            ghosts.insert(ObjectIdentifier(instance))
+            objectPoolMutationQueue.async {
+                self.ghosts.insert(ObjectIdentifier(instance))
+            }
         }
         
         public func isGhost(_ instance: BaseModel) -> Bool {
-            return ghosts.contains(ObjectIdentifier(instance))
+            return objectPoolMutationQueue.sync {
+                return ghosts.contains(ObjectIdentifier(instance))
+            }
         }
         
         /// Instantiates a model from a Document unless the model is alraedy in-memory

        
        /// Handles automatically saving models so they don't get lost when the server randomly crashes/shuts down
        fileprivate func autoSave() throws {
            let oldObjects = storage.filter({ $0.value.instantiation.timeIntervalSinceNow < -(minimumAutosaveAge) })
            for (_, val) in oldObjects {
                try (val.instance.value as? BaseModel)?.save()
            }

        
        /// Saves an object after being deinitialized
        public func handleDeinit<M: BaseModel>(_ instance: M) {
            objectPoolMutationQueue.async {
                self.ghosts.remove(ObjectIdentifier(instance))
            }
            
            do {
                if objectPoolMutationQueue.sync(execute: { !invalidatedObjectIds.contains(instance._id) }) {
                    try instance.save()
                }
            } catch {
