 
     // Drops the database.
     @objc public func drop(completion: ((_ error: NSError?) -> Void)? = nil) {
+        
+        let completeWithNil = {
+            DispatchQueue.main.async {
+                completion?(nil)
+            }
+        }
+        
         self.writerContext.performAndWait {
             self.writerContext.reset()
 
             self.mainContext.performAndWait {
                 self.mainContext.reset()
-
-                self.persistentStoreCoordinator.performAndWait {
-                    for store in self.persistentStoreCoordinator.persistentStores {
-                        guard let storeURL = store.url else { continue }
-                        try! self.oldDrop(storeURL: storeURL)
+                
+                if let coordinator = self.persistentStoreCoordinator {
+                    coordinator.performAndWait {
+                        for store in coordinator.persistentStores {
+                            guard let storeURL = store.url else { continue }
+                            try? self.oldDrop(storeURL: storeURL)
+                        }
+                        completeWithNil()
                     }
-
-                    DispatchQueue.main.async {
-                        completion?(nil)
-                    }
+                } else {
+                    completeWithNil()
                 }
             }
         }

     - parameter storeType: The store type to be used, you have .InMemory and .SQLite, the first one is memory
     based and doesn't save to disk, while the second one creates a .sqlite file and stores things there.
     */
    @objc public init(modelName: String, bundle: Bundle, storeType: DataStackStoreType) {
        self.modelName = modelName
        self.modelBundle = bundle
        self.storeType = storeType
        self.model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName)

        super.init()
    }

     - parameter storeType: The store type to be used, you have .InMemory and .SQLite, the first one is memory
     based and doesn't save to disk, while the second one creates a .sqlite file and stores things there.
     */
    @objc public init?(modelName: String, storeType: DataStackStoreType) {
        
        guard let model = NSManagedObjectModel(bundle: self.modelBundle, name: self.modelName) else { return nil }
        
        self.modelName = modelName
        self.storeType = storeType
        self.model = model

        super.init()
    }
