removing trailing spaces from search param