load and write data