remove trailing whitespaces from titles