Added extra group by for subscription type