fixed bughs in addhostids function, but services in matrix do not appear properly. Code still not ready