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

    }
    
    func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) {
        queue.async(flags: .barrier) {
            guard let task = self.tasks[urlSchemeTask.request] else {
                return
            }
            if task.state == .running {
                task.cancel()
            }
            self.tasks.removeValue(forKey: urlSchemeTask.request)
        }
    }
}


           
        default:
            
            guard self.schemeTaskIsActive(urlSchemeTask: urlSchemeTask) else {
                return
            }
            
            guard let defaultURL = defaultHandler.urlForPathComponents(pathComponents, requestURL: requestURL) else {
                urlSchemeTask.didFailWithError(SchemeHandlerError.invalidParameters)
                activeSchemeTasks.remove(urlSchemeTask)
                return
            }
            
