rewrite conn.transaction