corrects formatting problem on popups due to unclosed div tag