Handling dialogs created without using templates