add tx with toposort