tweaked text input to run query properly no matter whether typeahead is used or not