         queue.addOperation {
             defer {
                 if let didFinishClosure = self.didFinishClosure {
-                    self.didFinishClosure = nil
-                    
                     DispatchQueue.main.async {
                         didFinishClosure()
+                        self.didFinishClosure = nil
                     }
                 }
             }

                try await(task)
                
                if let didFinishWithValueClosure = self.didFinishWithValueClosure {
                    self.didFinishWithValueClosure = nil
                    
                    DispatchQueue.main.async {
                        didFinishWithValueClosure(task.value!)
                    }
                }
            }
            catch let error {
                if error.isUserCancelled {
                    if let didCancelClosure = self.didCancelClosure {
                        self.didCancelClosure = nil
                        
                        DispatchQueue.main.async {
                            didCancelClosure()
                        }
                    }
                }
                else {
                    if let didFinishWithErrorClosure = self.didFinishWithErrorClosure {
                        self.didFinishWithErrorClosure = nil
                        
                        DispatchQueue.main.async {
                            didFinishWithErrorClosure(error)
                        }
                    }
                }

            await(task)
            
            if let didFinishWithValueClosure = self.didFinishWithValueClosure {
                DispatchQueue.main.async {
                    didFinishWithValueClosure(task.value!)
                    self.didFinishWithValueClosure = nil
                }
            }
        }
