made log really nice, added a transaction around commit logic