Fixed an issue with modal dialogs