fix page number is bigger than actual page count issue