error checking of TX
cleanup TM and TX log