Changed from NSObject to AnyObject in Promise