Fixed incorrect pagination count issue