more proper way to prevent hangs with the popup, and doesn't block close from the address bar