modified code that determines if a page is public