Test if host & path are defined

before even working with them