automatically strip trailing whitespace