added pageName logic