diff --git a/subscriptions_ui.module b/subscriptions_ui.module
index 96b07b4..12300ca 100644
--- a/subscriptions_ui.module
+++ b/subscriptions_ui.module
@@ -284,7 +284,8 @@ function theme_subscriptions_ui_table($element) {
     }
     $rows[] = $row;
   }
-  unset($headers[end(array_keys($headers))]['width']);
+  $header_keys = array_keys($headers);
+  unset($headers[end($header_keys)]['width']);
   $output = theme('table', $headers, $rows);
   $output .= drupal_render($element);
   drupal_add_js(drupal_get_path('module', 'subscriptions') .'/subscriptions_tableselect.js', 'module');
