     private let session = NSURLSession.sharedSession()
     internal var text: String!
     internal var result: [String: AnyObject] = [:]
+    internal var wasOnMainThread = true
     
     // MARK: - Constructor
     public init() {

                    // Try to get the page with its default enconding
                    var source = try String(contentsOfURL: sourceUrl!).extendedTrim
                    
                    dispatch_async(dispatch_get_main_queue()) {
                        
                        source = self.cleanSource(source)
                        
                        self.performPageCrawling(source)
                        
                        completion()
                        
                    }
                    
                } catch _ as NSError {

    public func preview(text: String!, onSuccess: ([String: AnyObject]) -> (), onError: (PreviewError) -> ()) {
        
        self.resetResult()
        self.wasOnMainThread = NSThread.isMainThread()
        
        self.text = text
        
