Add isset check to getPageURL()