adding events to modals