add state counter.