Modified nextPage method.