Updated code to follow drupal standard