bug fix in search query