prune trailing whitespace