Cherry picked from 356caec773f14fff5632cccc901126eb9085293e - 557e644c8722888f7715403cfc1d22ded320babc