bug fix / cherrypick 654c2163c7fdaa0ddb485faa88e7b26da3b3bb00