fixes on searching logic ( query)