add newline for write