record mode and event detector for update of the state