Working code for #34612