backported p2 fix from release-157