fix some event bugs