defined change-page function