Fixed bug with counter.
Fixed bug with counter.