fix event delegation in modals.