changed a bug that set hostid to -1