Correctly wait for transaction end in buys