Added countQuery flag