backport from tess