next and prev page functions functional