Fix global variable leak
Dialogs can be closed from within shown component