remove new lines from end of files