totalPageNumber method fixed