             completeBlock(groupIds, nil)
         }
     }
-	
-	open func updateGroup(_ group: DKAssetGroup, collection: PHAssetCollection) {
-		group.groupName = collection.localizedTitle
-		group.originalCollection = collection
-	}
-	
-	open func updateGroup(_ group: DKAssetGroup, fetchResult: PHFetchResult<PHAsset>) {
+
+    open func updateGroup(_ group: DKAssetGroup, collection: PHAssetCollection) {
+        group.groupName = collection.localizedTitle
+        group.originalCollection = collection
+    }
+
+    open func updateGroup(_ group: DKAssetGroup, fetchResult: PHFetchResult<PHAsset>) {
         group.fetchResult = fetchResult
         group.displayCount = self.configuration.fetchLimit
-	}
-    
+    }
+
 	// MARK: - PHPhotoLibraryChangeObserver methods
 	
 	open func photoLibraryDidChange(_ changeInstance: PHChange) {
         guard let groups = self.groups?.values else { return  }
         
         for group in groups {
-			if let changeDetails = changeInstance.changeDetails(for: group.originalCollection) {
+			if let originalCollection = group.originalCollection,
+                let changeDetails = changeInstance.changeDetails(for: originalCollection)
+            {
 				if changeDetails.objectWasDeleted {
 					self.groups?[group.groupId] = nil
                     notify(with: #selector(DKImageGroupDataManagerObserver.groupDidRemove(groupId:)),

        latestAsset.fetchImage(with: size, options: options, completeBlock: completeBlock)
	}
	
	open func fetchAsset(_ group: DKAssetGroup, index: Int) -> DKAsset {
        let phAsset = fetchPHAsset(group, index: index)
        if let asset = assets[phAsset.localIdentifier] {
            return asset
        }

        let asset = DKAsset(originalAsset:phAsset)
        assets[phAsset.localIdentifier] = asset
        return asset
	}
    
    open func fetchPHAsset(_ group: DKAssetGroup, index: Int) -> PHAsset {
        return group.fetchResult[group.fetchResult.count - 1 - index]
    }
    
    open func makeDKAssetGroup(with collection: PHAssetCollection) -> DKAssetGroup {
        let assetGroup = DKAssetGroup()
        assetGroup.groupId = collection.localIdentifier
        self.updateGroup(assetGroup, collection: collection)
        
        let fetchResult = PHAsset.fetchAssets(in: collection, options: self.configuration.assetFetchOptions)
        self.updateGroup(assetGroup, fetchResult: fetchResult)
        
        return assetGroup
    }
    

				}
				
				if let objectAfterChanges = changeDetails.objectAfterChanges {
                    if let groups = self.groups, let group = groups[group.groupId] {
                        updateGroup(group, collection: objectAfterChanges)
                    } else {
                        assertionFailure("Expect group with id:\(group.groupId)")
