fixed the code to add maintenance hosts.