bug fix: don't restore buttons if the dialog is already destroyed