support countOnly parameter