adding extra spaces at the end of the files