fixed bug with multiple dialogs