remove trailing blanks on write