fix check for studygroups (again thanks to elmar for this contribution)