triming traling whitespaces on save