Fixed an issue that arose when activting dialogs twice