updated add transaction function