         var trustPolicies: [String: ServerTrustPolicy] = [:]
         private var tasks: [Task] = []
         private let queue: OperationQueue
-
-        init(queue: OperationQueue) {
+        private let responseQueue: DispatchQueue
+
+        init(queue: OperationQueue, responseQueue: DispatchQueue) {
             self.queue = queue
+            self.responseQueue = responseQueue
         }
 
         func add(task: Task) {

            let total = totalBytesExpectedToSend != NSURLSessionTransferSizeUnknown ? totalBytesExpectedToSend : nil
            httpTask.upload.bytes = totalBytesSent
            httpTask.upload.totalBytes = total
            httpTask.upload.callback?(httpTask.upload.bytes, httpTask.upload.totalBytes)
        }

        func urlSession(

            guard let httpTask = tasks.first(where: { $0.task === dataTask }) else { return }

            httpTask.data.append(data)
            let bytes = Int64(httpTask.data.count)
            httpTask.download.bytes = bytes
            let total = httpTask.download.totalBytes
            responseQueue.async {
                httpTask.download.callback?(bytes, total)
            }
        }

        func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
