fix write command