Triggering an event after the dialog is closed