remove extra spaces at end of line