implemented checking for duplicate groups when creating a new group