added more explicit group checking