add transaction function