Made changes to dynamically allocate relay to a group.