Fixed next page function