fix bug in next_page
add coverage