add the function to go to next page and go to the pre [age.