copied code to different index sorting pages