fixes transaction handling for stored procedures