Removed group by clause and added the select distinct

Removed group by clause and added the select distinct