auto trim trailing whitespaces