fixed SQL errors when we added row_id