 final class SchemeHandler: NSObject {
     @objc let scheme: String
     private let session: Session
-    private var tasks: [URLRequest: URLSessionTask] = [:]
-    private var queue: DispatchQueue = DispatchQueue(label: "SchemeHandlerQueue", qos: .default, attributes: [.concurrent], autoreleaseFrequency: .workItem, target: nil)
+    private var activeSessionTasks: [URLRequest: URLSessionTask] = [:]
+    private var activeSchemeTasks = NSMutableSet(array: [])
     
     private let cache: SchemeHandlerCache
     private let fileHandler: FileHandler

extension SchemeHandler: WKURLSchemeHandler {
    
    func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) {
        var request = urlSchemeTask.request
        guard let requestURL = request.url else {
            urlSchemeTask.didFailWithError(SchemeHandlerError.invalidParameters)

                urlSchemeTask.didReceive(data)
            }
            urlSchemeTask.didFinish()
            self.activeSchemeTasks.remove(urlSchemeTask)
        }
        
        activeSchemeTasks.add(urlSchemeTask)
        
        switch baseComponent {
        case FileHandler.basePath:
