prevent a crash on an invalid hostname