cherry-picking commit cf7c0e4dd3be44a354ad2431c3e0925cb85f79e2