fix next try page bug
merge functions of handling different pages into one