         context.obtainPermanentIDsBeforeSaving()
         context.registerContextDidSaveNotification()
         return context
-    }()
+        }()
     
     private lazy var rootSaveingContext : NSManagedObjectContext = {
         var context = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
-        context.performBlock({
+        context.performBlockAndWait({
             context.persistentStoreCoordinator = self.defaultCoordinator
         })
         context.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
         return context
-    }()
+        }()
     
     private lazy var defaultCoordinator : NSPersistentStoreCoordinator = {
         var coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.defaultManagedObjectModel)
         
-        var error: NSError?
-        let store: NSPersistentStore?
         do {
-            store = try coordinator.addPersistentStoreWithType(
+            try coordinator.addPersistentStoreWithType(
+                NSSQLiteStoreType,
+                configuration: nil,
+                URL: self.storeURL(),
+                options: nil)
+        } catch let error as NSError {
+            // re create
+            let isMigrationError = (error.code == NSPersistentStoreIncompatibleVersionHashError) || (error.code == NSMigrationMissingSourceModelError)
+            
+            if error.domain == NSCocoaErrorDomain && isMigrationError {
+                do {
+                    try NSFileManager.defaultManager().removeItemAtURL(self.storeURL())
+                } catch let error as NSError {
+                    print("NSFileManager removeItemAtURL error : " + error.localizedDescription)
+                    abort()
+                }
+                
+                do {
+                    try coordinator.addPersistentStoreWithType(
                         NSSQLiteStoreType,
                         configuration: nil,
                         URL: self.storeURL(),
                         options: nil)
-        } catch var error1 as NSError {
-            error = error1
-            store = nil
-        } catch {
-            fatalError()
-        }
-        
-        if let _error = error {
-            // re create
-            let isMigrationError = (_error.code == NSPersistentStoreIncompatibleVersionHashError) || (_error.code == NSMigrationMissingSourceModelError)
-            if _error.domain == NSCocoaErrorDomain && isMigrationError == true {
-                do {
-                    try NSFileManager.defaultManager().removeItemAtURL(self.storeURL())
-                } catch _ {
-                }
-                var reError: NSError?
-                let reStore: NSPersistentStore?
-                do {
-                    reStore = try coordinator.addPersistentStoreWithType(
-                                        NSSQLiteStoreType,
-                                        configuration: nil,
-                                        URL: self.storeURL(),
-                                        options: nil)
-                } catch var error as NSError {
-                    reError = error
-                    reStore = nil
-                } catch {
-                    fatalError()
-                }
-                if reStore == nil {
-                    print("create persistentStores error : " + reError!.localizedDescription)
+                } catch let error as NSError {
+                    print("create persistentStores error : " + error.localizedDescription)
                     abort()
                 }
             }

            },
            completion: completion)
    }
}

        }
        
        return coordinator
        }()
    
    private lazy var defaultManagedObjectModel : NSManagedObjectModel = {
        if self.modelName == nil {
            assert(true, "need set model name")
        }
        
        var modelURL = NSBundle.mainBundle().URLForResource(self.modelName!, withExtension: "momd")
        // need unit test
        if modelURL == nil {
            modelURL = NSBundle(forClass: SwCD.self).URLForResource(self.modelName!, withExtension: "momd")
        }
        var model = NSManagedObjectModel(contentsOfURL: modelURL!)
        return model!
        }()
    
    private var defaultPersistentStore : NSPersistentStore?
    
