add transaction and doctest