fixed Undefined variable error https://drupal.org/node/1877600#comment-6894460