     private let semaphore = DispatchSemaphore(value: 1)
     
     private weak var currentAVExportSession: AVAssetExportSession?
-    private var requestIDs = [DKImageRequestID : Int]()
+    private var requests = [DKAsset]()
     private var isCancelled = false
     
     public init(configuration: DKImageAssetExporterConfiguration) {

                    progress(p)
                }
                
                let requestID = getImageDataManager().fetchImageData(for: asset, options: options, completeBlock: { (data, info) in
                    DKImageAssetExporter.ioQueue.async {
                        if var imageData = data {
                            if let info = info, let fileURL = info["PHImageFileURLKey"] as? NSURL {
                                asset.fileName = fileURL.lastPathComponent
                            }
                            
                            if FileManager.default.fileExists(atPath: asset.localTemporaryPath!.path) {

        defer { objc_sync_exit(self) }
        
        self.isCancelled = true
        for asset in self.requests {
            asset.cancelCurrentRequest()
        }
        self.requests.removeAll()
    }
    
    private func add(asset: DKAsset) {
        objc_sync_enter(self)
        defer { objc_sync_exit(self) }
        
        if self.isCancelled {
            asset.cancelCurrentRequest()
        } else {
            self.requests.append(asset)
        }
    }
    
