fix: check number of pages before calling hintPage

otherwise, we will reach out page limit when reached last page
Merge pull request #720 from houqp/new_ui_fix

fix: check number of pages before calling hintPage