add tnx support; need review and test