add core data read and write