removed self-reference of group table from subquery