             request.completion(true, styledImage, cacheType)
         }
 
-        cache.setObject(styledImage, forKey: request.key)
+        cache.setObject(styledImage, forKey: request.key as NSString)
     }
 
     fileprivate func completeRequestsWithURL(_ URL: Foundation.URL, image: UIImage, cacheType: CacheType) {


    fileprivate static let sharedInstance = AvatarPod()

    fileprivate let cache = NSCache()

    fileprivate lazy var session = URLSession(configuration: URLSessionConfiguration.default)



                    // if can find styledImage in cache, no need to generate it again or save

                    if let styledImage = self.cache.object(forKey: request.key as NSString) {
                        self.completeRequest(request, withStyledImage: styledImage, cacheType: cacheType)

                    } else {
