metadata read and write