fix for race condition between creating a new transaction, reading tree state and commiting tree state