     }
     
     private func addObservers() {
-        NSNotificationCenter.defaultCenter().addObserver(
-            self,
-            selector: Selector("persistentStoreCoordinatorStoresWillChange:"),
-            name: NSPersistentStoreCoordinatorStoresWillChangeNotification,
-            object: self.coordinator
-        )
-        
-        NSNotificationCenter.defaultCenter().addObserver(
-            self,
-            selector: Selector("persistentStoreCoordinatorStoresDidChange:"),
-            name: NSPersistentStoreCoordinatorStoresDidChangeNotification,
-            object: self.coordinator
-        )
-        
-        NSNotificationCenter.defaultCenter().addObserver(
-            self,
-            selector: Selector("persistentStoreDidImportUbiquitousContentChanges:"),
-            name: NSPersistentStoreDidImportUbiquitousContentChangesNotification,
-            object: self.coordinator
-        )
+        if self.contextOptions.stackType == .SQLite && self.contextOptions.ubiquityEnabled {
+            NSNotificationCenter.defaultCenter().addObserver(
+                self,
+                selector: Selector("persistentStoreCoordinatorStoresWillChange:"),
+                name: NSPersistentStoreCoordinatorStoresWillChangeNotification,
+                object: self.coordinator
+            )
+            
+            NSNotificationCenter.defaultCenter().addObserver(
+                self,
+                selector: Selector("persistentStoreCoordinatorStoresDidChange:"),
+                name: NSPersistentStoreCoordinatorStoresDidChangeNotification,
+                object: self.coordinator
+            )
+            
+            NSNotificationCenter.defaultCenter().addObserver(
+                self,
+                selector: Selector("persistentStoreDidImportUbiquitousContentChanges:"),
+                name: NSPersistentStoreDidImportUbiquitousContentChangesNotification,
+                object: self.coordinator
+            )
+        }
     }
     
     private func removeObservers() {


private final class StackBackgroundManagedObjectContext: NSManagedObjectContext {
    
    private var mainContext: NSManagedObjectContext! {
        didSet {
            if self.mainContext != oldValue {
                if self.mainContext != nil {
                    backgroundContexts.addObject(self)
                    
                    NSNotificationCenter.defaultCenter().addObserver(
                        self,
                        selector: Selector("backgroundManagedObjectContextDidSave:"),
                        name: NSManagedObjectContextDidSaveNotification,
                        object: self
                    )
                }
                else {
                    NSNotificationCenter.defaultCenter().removeObserver(self, name: NSManagedObjectContextDidSaveNotification, object: self)
                    
                    backgroundContexts.removeObject(self)
                }
            }
        }
    }
    
    deinit {
        self.mainContext = nil // setting mainContext to nil also removes notifications
    }
    
    @objc private func backgroundManagedObjectContextDidSave(notification: NSNotification) {
        self.mainContext.performBlock {
            self.mainContext.mergeChangesFromContextDidSaveNotification(notification)
        }
    }
    
}


            
            currentContext = currentContext?.parentContext
        }
    }
    
    @objc private func persistentStoreDidImportUbiquitousContentChanges(notification: NSNotification) {
