Added validation against non-existent pages.