removes extra blank line at the end of the file