remove trailing spaces from title and subtitle