Fix index issues

fix event check issue