                     urlSchemeTask.didReceive(response)
                 }
             }
-        }, data: { data in
-            DispatchQueue.main.async {
+        }, data: { [weak urlSchemeTask] data in
+            DispatchQueue.main.async {
+                guard let urlSchemeTask = urlSchemeTask else {
+                    return
+                }
                 guard self.schemeTaskIsActive(urlSchemeTask: urlSchemeTask) else {
                     return
                 }
                 urlSchemeTask.didReceive(data)
             }
-        }, success: {
-            DispatchQueue.main.async {
+        }, success: { [weak urlSchemeTask] in
+            DispatchQueue.main.async {
+                guard let urlSchemeTask = urlSchemeTask else {
+                    return
+                }
                 guard self.schemeTaskIsActive(urlSchemeTask: urlSchemeTask) else {
                     return
                 }

        guard schemeTaskIsActive(urlSchemeTask: urlSchemeTask) else {
            return
        }
        
        let callback = Session.Callback(response: {  response in
            DispatchQueue.main.async {
                guard self.schemeTaskIsActive(urlSchemeTask: urlSchemeTask) else {
                    return
                }

    private let articleSectionHandler: ArticleSectionHandler
    private let apiHandler: APIHandler
    private let defaultHandler: DefaultHandler
    private let cacheQueue: OperationQueue = OperationQueue()
    
    @objc public static let shared = SchemeHandler(scheme: WMFURLSchemeHandlerScheme, session: Session.shared)
    
