Added updating of global counters