fixing cherry pick #1787