Fix bug in search query