                     }
                     notify(with: #selector(DKImageGroupDataManagerObserver.groupDidUpdate(groupId:)),
                            object: group.groupId as AnyObject?)
-				}
-			}
-			
-			if let fetchResult = group.fetchResult, let changeDetails = changeInstance.changeDetails(for: fetchResult) {
+                }
+            }
+
+            if let fetchResult = group.fetchResult, let changeDetails = changeInstance.changeDetails(for: fetchResult) {
                 let removedAssets = changeDetails.removedObjects.map{ DKAsset(originalAsset: $0) }
-				if removedAssets.count > 0 {
+                if removedAssets.count > 0 {
                     self.notify(with: #selector(DKImageGroupDataManagerObserver.group(groupId:didRemoveAssets:)),
                                 object: group.groupId as AnyObject?,
                                 objectTwo: removedAssets as AnyObject?)
-				}
-				self.updateGroup(group, fetchResult: changeDetails.fetchResultAfterChanges)
-				
+                }
+                self.updateGroup(group, fetchResult: changeDetails.fetchResultAfterChanges)
+
                 let insertedAssets = changeDetails.insertedObjects.map{ DKAsset(originalAsset: $0) }
-				if insertedAssets.count > 0  {
+                if insertedAssets.count > 0  {
                     self.notify(with: #selector(DKImageGroupDataManagerObserver.group(groupId:didInsertAssets:)),
                                 object: group.groupId as AnyObject?,
                                 objectTwo: insertedAssets as AnyObject?)
-				}
+                }
                 
                 self.notify(with: #selector(DKImageGroupDataManagerObserver.groupDidUpdateComplete(groupId:)),
                             object: group.groupId as AnyObject?)

            completeBlock(nil, nil)
            return
        }
		if group.totalCount == 0 {
			completeBlock(nil, nil)
			return
		}
		
        guard let lastResult = group.fetchResult?.lastObject else {
            assertionFailure("Expect latestAsset")
            completeBlock(nil, nil)

        super.init()
    }
    
    deinit {
        PHPhotoLibrary.shared().unregisterChangeObserver(self)
    }

    open func invalidate() {
        self.groupIds?.removeAll()
        self.groups?.removeAll()
        self.assets.removeAll()

        PHPhotoLibrary.shared().unregisterChangeObserver(self)
    }

    open func fetchGroups(_ completeBlock: @escaping (_ groups: [String]?, _ error: NSError?) -> Void) {
        let assetGroupTypes = self.configuration.assetGroupTypes
