copy changes from PR that fixes this
build