updated the code as per drupal coding standards