diff --git a/browserid/static/relay/relay.js b/browserid/static/relay/relay.js
index 962d2c311cf7cdf8ef5ea7f89bf3b508437874aa..32a46ee5a4eb7dd731be0dedf92d6015433c2ec5 100644
--- a/browserid/static/relay/relay.js
+++ b/browserid/static/relay/relay.js
@@ -44,20 +44,14 @@
   };
 
   var ipServer = "https://browserid.org",
+      transaction,
+      origin,
       chan = Channel.build( {
         window: window.parent,
         origin: "*",
         scope: "mozid"
-      } ),
-      transaction,
-      origin;
+      } );
 
-  chan.bind("getVerifiedEmail", function(trans, s) {
-    origin = trans.origin;
-    trans.delayReturn(true);
-
-    transaction = trans;
-  });
 
   window.register_dialog = function(callback) {
     // register the dialog, tell the dialog what the origin is.  
@@ -78,4 +72,14 @@
         }
       }
   };
+
+  console.log('adding browserid_relay functions');
+
+  chan.bind("getVerifiedEmail", function(trans, s) {
+    origin = trans.origin;
+    trans.delayReturn(true);
+
+    transaction = trans;
+  });
+
 }());