Added trapping; switched from c/count instead of c/distinct-count