diff --git a/code/javascript/core/scripts/selenium-browserbot.js b/code/javascript/core/scripts/selenium-browserbot.js
index <HASH>..<HASH> 100644
--- a/code/javascript/core/scripts/selenium-browserbot.js
+++ b/code/javascript/core/scripts/selenium-browserbot.js
@@ -395,10 +395,10 @@ BrowserBot.prototype.setOpenLocation = function(win, loc) {
         var marker = null;
         try {
             marker = this.isPollingForLoad(win);
+            if (marker && win.location[marker]) {
+                win.location[marker] = false;
+            }
         } catch (e) {} // DGF don't know why, but this often fails
-        if (marker && win.location[marker]) {
-            win.location[marker] = false;
-        }
     } else {
         win.location.href = loc;
     }
Another robustness enhancement for HTA mode


r<I>