remove space at the end of the file