addEvent logic updated