automatically add newline at the end of a file to avoid some parse errors