Change return type for count_events #2