update counter logiic and counter. Still static counter