             let total = totalBytesExpectedToSend != NSURLSessionTransferSizeUnknown ? totalBytesExpectedToSend : nil
             httpTask.upload.bytes = totalBytesSent
             httpTask.upload.totalBytes = total
-            httpTask.upload.callback?(httpTask.upload.bytes, httpTask.upload.totalBytes)
+            responseQueue.async {
+                httpTask.upload.callback?(totalBytesSent, total)
+            }
         }
 
         func urlSession(

        var trustPolicies: [String: ServerTrustPolicy] = [:]
        private var tasks: [Task] = []
        private let queue: OperationQueue

        init(queue: OperationQueue) {
            self.queue = queue
        }

        func add(task: Task) {


            let total = response.expectedContentLength != NSURLSessionTransferSizeUnknown ? response.expectedContentLength : nil
            httpTask.download.totalBytes = total
            let bytes = httpTask.download.bytes
            responseQueue.async {
                httpTask.download.callback?(bytes, total)
            }
            completionHandler(.allow)
        }

