improve record count function
make addgrouping specify table name