removing white space at the end of the textarea content