cherry-pick 50d0cb02c53f7b8a21264914cf2a3750eff394e5