fixed casting problem in CountsCollector