fix broken inserts, pass on res.rows to get insertId