some logic to support a callback and accept string as single host