fix for correct work of counters