fixed last line ignored if no new line at the end