Fixed the page ordering bug