             do {
                 let data = try Data(contentsOf: sourceUrl!)
                 if let source = String(data: data, encoding: .utf8) {
-                    self.parseHtmlString(source, canonicalUrl: canonicalUrl, completion: completion)
+                    if !cancellable.isCancelled {
+                        self.parseHtmlString(source, canonicalUrl: canonicalUrl, completion: completion)
+                    }
                 } else {
                     self.tryAnotherEnconding(sourceUrl!, canonicalUrl: canonicalUrl, data: data, encodingArray: String.availableStringEncodings, completion: completion, onError: onError)
                 }
             } catch {
-                onError(.cannotBeOpened(sourceUrl!.absoluteString))
+                if !cancellable.isCancelled {
+                    onError(.cannotBeOpened(sourceUrl!.absoluteString))
+                }
             }
         }
     }

    }
    
    // Unshorten URL by following redirections
    fileprivate func unshortenURL(_ url: URL, completion: @escaping (URL) -> Void, onError: @escaping (PreviewError) -> Void) {
        var task: URLSessionDataTask? = nil
        var request = URLRequest(url: url)
        request.httpMethod = "HEAD"

    
    // MARK: - Functions
    // Make preview
    @discardableResult open func preview(_ text: String!, onSuccess: @escaping (Response) -> Void, onError: @escaping (PreviewError) -> Void) -> () -> Void {
        
        let cancellable = Cancellable()
        
        let successResponseQueue = { (response: Response) in
            if !cancellable.isCancelled {
            self.responseQueue.async {
                if !cancellable.isCancelled {
                    onSuccess(response)
                }
            }
            }
        }
        
        let errorResponseQueue = { (error: PreviewError) in
            if !cancellable.isCancelled {
            self.responseQueue.async {
                if !cancellable.isCancelled {
                onError(error)
                }
            }
            }
        }
        
        workQueue.async {
            if cancellable.isCancelled {return}
            
            if let url = self.extractURL(text: text) {
                if let result = self.cache.slp_getCachedResponse(url: url.absoluteString) {
                    successResponseQueue(result)
                } else {
                    self.unshortenURL(url, cancellable: cancellable, completion: { unshortened in
                        if let result = self.cache.slp_getCachedResponse(url: unshortened.absoluteString) {
                            successResponseQueue(result)
                        } else {
                            
                            let canonicalUrl = self.extractCanonicalURL(unshortened)
                            
                            self.extractInfo(unshortened, cancellable: cancellable, canonicalUrl: canonicalUrl, completion: { result in
                                
                                var result = result
                                
