fix duplicate event bugs