fix when currentPage is major than pageCount, fix inserting a NaN in inputs

shouldn't this be currentPage = pageCount, so it's the last page?

otherwise, this logic looks right.