Fix duplicate events in transactions