trim spaces at end of lines