Added uid column in group by clause