fix destroyDialog