backport fix on 1.8