added functionality for multiple hostnames