Fixed the incompatibility with Drupal 7