automatically add newline to end of file when missing