manages state history