changes to begin_trans. untested