extract next_page out and use it