added get_hosts method