add countPets helper