make sure host is present before trying to do anything with it