Fix bug in search query part 2