patched up #866