change the .group() logic to .select()