move to preChecks() in page.php