overWrite getTotalCount method