diff --git a/includes/ajax.inc b/includes/ajax.inc
index 05416af..ec0ff10 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -563,20 +563,21 @@ function ctools_ajax_render_error($error = '') {
  */
 function ctools_ajax_associate_url_to_element(&$form, &$form_element, $dest, $type = '') {
   drupal_add_js('misc/jquery.form.js', 'core');
+
+  // We need an unique ID to associate $form_element with its hidden element.
   if (!isset($form_element['#id'])) {
-    //Create a unique ID to associate $form_element and hidden elements since we dont have an ID
     $form_element['#id'] = uniqid('ctools-ajax-url-');
+  }
 
-    if (empty($type)) {
-      $type = $form_element['#type'] == 'submit' ? 'ctools-use-ajax' : 'ctools-use-ajax-onchange';
-    }
+  if (empty($type)) {
+    $type = $form_element['#type'] == 'submit' ? 'ctools-use-ajax' : 'ctools-use-ajax-onchange';
+  }
 
-    if (empty($form_element['#attributes']['class'])) {
-      $form_element['#attributes']['class'] = $type;
-    }
-    else {
-      $form_element['#attributes']['class'] .= " $type";
-    }
+  if (empty($form_element['#attributes']['class'])) {
+    $form_element['#attributes']['class'] = $type;
+  }
+  else {
+    $form_element['#attributes']['class'] .= " $type";
   }
 
   //Add hidden form element to hold base URL
