some bugfixes in hosts script