added the change page function.