added patch from http://drupal.org/node/1513490#comment-7087474