group id detection improved