I think you can get rid of "transactionFinished" if you put the following code in the block above.