added function to remove hosts and groups