fixed some event bugs