Fixing bug in group creaton