auto detect group id