added ability to count query items