ensure grouping fix: can't rely on new_record? check