changed method to get event count