done restructuring. stack error with historyStates