re-introduce @redmunds changes to fix #7886