Make inGroup variable atomic