                     // save images to local
 
                     request.avatar.saveOriginalImage(image, styledImage: styledImage)
-                }
-            })
+                })
+            }
 
             self.requestPool.removeRequestsWithURL(URL)
         }


import UIKit

func ==(lhs: AvatarPod.Request, rhs: AvatarPod.Request) -> Bool {
    return lhs.key == rhs.key
}

public class AvatarPod {

    static let sharedInstance = AvatarPod()

    private init() {
    }

    let cache = NSCache()


        cache.setObject(styledImage, forKey: request.key)
    }

    private func completeRequestsWithURL(URL: NSURL, image: UIImage, cacheType: CacheType) {

        dispatch_async(requestQueue) {

            let requests = self.requestPool.requestsWithURL(URL)

            dispatch_async(self.cacheQueue) {

                requests.forEach({ request in

                    let styledImage = image.navi_avatarImageWithStyle(request.avatar.style)

