Finish to code the change page function