count events properly