 
     @objc private func backgroundManagedObjectContextDidSave(notification: NSNotification) {
         if let mainContext = self.stack.mainManagedObjectContext {
-            mainContext.performBlock {
+            mainContext.performBlockAndWait {
                 mainContext.mergeChangesFromContextDidSaveNotification(notification)
             }
         }
     }
     
     @objc private func persistentStoreCoordinatorStoresWillChange(notification: NSNotification) {
-        self.performBlock {
+        self.performBlockAndWait {
             var error: NSError? = nil
             self.save(&error)
             self.reset()

        var currentContext: NSManagedObjectContext? = self.mainManagedObjectContext
        
        while let c = currentContext {
            c.performBlock {
                c.reset()
            }
            

        var currentContext: NSManagedObjectContext? = self.mainManagedObjectContext
        
        while let c = currentContext {
            c.performBlockAndWait {
                c.mergeChangesFromContextDidSaveNotification(notification)
            }
            
