ATTRX backport patch by maggu2810