Added some transaction logic.