added group by to list builder; corrected count for group by