fix the looping bug in page.php