         let task = urlCustomSession.dataTask(with: requestToMock, completionHandler: { (data, response, error) -> Void in
             if let data = data {
                 let stringResponse = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String
-                
-                self.webView.loadHTMLString(stringResponse, baseURL: nil)
+                DispatchQueue.main.async {
+                    self.webView.loadHTMLString(stringResponse, baseURL: nil)
+                }
             }
         }) 
         task.resume()

            if let data = data {
                let stringResponse = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String
                print("Real Response : \(stringResponse)")
                
                self.webView.loadHTMLString(stringResponse, baseURL: nil)
            }
        }) 
        task.resume()

        let task = urlSession.dataTask(with: requestToMock, completionHandler: { (data, response, error) -> Void in
            if let data = data {
                let stringResponse = NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String
                DispatchQueue.main.async {
                    self.webView.loadHTMLString(stringResponse, baseURL: nil)
                }
            }
        }) 
        task.resume()
