*ported to forge 848