Fixing bug, the transaction was being created everyime when it should be updated