fix coredata bug