add option to set a newline at EOF