essential update

fix bug in sys_doeventstate()