Update Page.php

added dynamic error checking