A small adjustment for write function.