fixed wrong nesting of groups