add transaction finish function