Add getAllGroup function