adding a delegate so the AppDelegte can know when the dialog was shows and which action was taken