fixed write command