Add method to remove trailing space before save file