Changed implementation of waitForDialogToClose()