Fixed issues when two dialogs are opened several times