delete trailing whitespace on save function.