Ref a2f661ea34d4146b97ecb9e7dae18b0a7cee931e (cherry picked from commit c227f66595b1af6e1de66277212360bf21c12efa)