Page permissions

Added isPageValid check.