write to file uses output stream, appends newline to file