added a method to check if a host exists