adding total count to pagination