Update writePages.php