updated both the read and write method of storage.