Fixed an issue where the dialog background wouldn't be deleted