modified the changePage example slightly