working modal on event click