enhance helper functions of page.php to declare script