only join transaction if necessary