trim trailing whitespace on save