added affected_rows wrap