added support for nested groups