add events logic