in logic done for query condition