Added type attribute to coredata