fix the ability to use targethost when defined.