fix write function