trucate unneeded spaces at end of line