modified getting total and filtered count