switch paramter from NSManagedObject to AnyObject