Refactored checkGroup to work with children group.