added model.id to group by clause. fixes #274