             // Fetch Image
             let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
             if let nsURL = NSURL(string: photoURL) {
-                session.dataTaskWithURL(nsURL, completionHandler: { [weak self](response: NSData?, data: NSURLResponse?, error: NSError?) in
+                var task: NSURLSessionDataTask!
+                task = session.dataTaskWithURL(nsURL, completionHandler: { [weak self](response: NSData?, data: NSURLResponse?, error: NSError?) in
                     if let _self = self {
                         
                         if error != nil {

                        
                        if let res = response, let image = UIImage(data: res) {
                            if _self.shouldCachePhotoURLImage {
                                SKCache.sharedCache.setImage(image, forKey: _self.photoURL)
                            }
                            dispatch_async(dispatch_get_main_queue()) {
                                _self.underlyingImage = image

                        }
                        session.finishTasksAndInvalidate()
                    }
                })
                task.resume()
            }
        }
    }
