Cherry picked 595854c2cefd99135aa12eb20d31f7ae9c435606