Added check for blank hostnames