Wrapped the function in a drupal behavior like a proper human being