applying patch submitted to drupal.org https://www.drupal.org/node/2295159#comment-8927869