Fix host issues

Cannot set property 'host' of undefined.