fix group functions variable bug