8.x backport fix for issue4211

backport issue 4211