Fixed the group subquery for activity stream