custom serialization for DataCounting