Added group management statement to function