patch from http://drupal.org/node/1766338#comment-6445882