adding transaction and fixing some todo/fixme