Listener to the dialog