patch for #19773 ported for 1.3.2