fix read/write treatment