bug fix on NSManagedObject