Fixed exception in dialogs

review: @gaurave