add events for rendering modal