Fixed bug in dialogs