Group function fixed - now it works