strip trailing space only after write the buffer/file