Fix search query bug for empty search