clean code
fix total event counter bug