 extension WTURLSessionManager:URLSessionDataDelegate{
     
     public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive response: URLResponse, completionHandler: @escaping (URLSession.ResponseDisposition) -> Swift.Void){
-        if let task = self[dataTask] {
+        if let task = self[dataTask] as? WTURLSessionDataTask {
             task.urlSession(session, dataTask: dataTask, didReceive: response, completionHandler: completionHandler)
         }else{
             completionHandler(URLSession.ResponseDisposition.allow)


public func dataTask(with request:URLRequest,completionHandler:@escaping completionHandler)->WTURLSessionTask{
    let task = WTURLSessionManager.default.session!.dataTask(with: request)
    let myTask = WTURLSessionTask(task: task)
    WTURLSessionManager.default[task] = myTask
    myTask.completionHandler = completionHandler
    return myTask

    }
    
    public func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data){
        if let task = self[dataTask] as? WTURLSessionDataTask {
            task.urlSession(session, dataTask: dataTask, didReceive: data)
        }else{
        }
