Fix write command