trim search string before passing it on