dialog method, dialogclose event, updated example