onBeforeAcceptDialog method