fix read to write