alternative implementation of state hander which stores history, ready for assertion checking