fixed bugs in test_hosts
fixed bugs in test_hosts