backport patch for PR36312