now it works well with a more complex environment of hosts