diff --git a/webform_conditional.module b/webform_conditional.module
index e123879..d1ad714 100644
--- a/webform_conditional.module
+++ b/webform_conditional.module
@@ -129,12 +129,11 @@ function webform_conditional_form_alter(&$form, $form_state, $form_id) {
         }
       }
     }
-  }
-  if (!empty($js_fields)) {
     //can't add javascript in this function or it will not be added if the form is built from cache.  Need to run "after_build" function
     $form['#after_build'][] = 'webform_conditional_add_js';
     $js_settings = array(
-      'fields' => $js_fields,
+      // Rewrite previous settings if the form is being rebuilt.
+      'fields' => isset($js_fields) ? $js_fields : FALSE,
       'nid' => $nid,
       'showSpeed' => NULL, //'fast',
     );
