diff --git a/browserid/static/dialog/controllers/page_controller.js b/browserid/static/dialog/controllers/page_controller.js
index 9532c18fad9a7055ff01ae725da79e4c2fd7b33f..724f37e5c240a091d137c9ac2f142a42effc4356 100644
--- a/browserid/static/dialog/controllers/page_controller.js
+++ b/browserid/static/dialog/controllers/page_controller.js
@@ -72,12 +72,12 @@
     },
 
     renderTemplates: function(body, body_vars) {
-      $("body").removeClass("waiting");
 
       if (body) {
         var bodyHtml = $.View("//dialog/views/" + body, body_vars);
         var form = $("#formWrap > form");
         form.html(bodyHtml).hide().fadeIn(ANIMATION_TIME, function() {
+          $("body").removeClass("waiting");
           form.find("input").eq(0).focus(); 
         });
       }
@@ -121,7 +121,7 @@
      * two fields, message, description.
      */
     errorDialog: function(info) {
-      $("#dialog").hide();
+      $("form").hide();
 
       $("#error_dialog .title").text(info.message);
       $("#error_dialog .content").text(info.description);