new method to count query hits