added group by to cron