a counter with persistence