better click handler management for modals