Implemented local storage for save the counters of each state.