automatically delete whitespaces before saving