Remove trailing whitespace before save