apply patch from https://www.drupal.org/node/1810656