Update to functions.php to bring it into line

added check to see if host exists at all