fixed write, read