added missing group by