fixed bug when creating groups