Fixed open and close dialogs