fix transactionBegun check