correcting transactionFunction custom function example