Replaced eventCount with events.count