keep a reference to the previous state