added better error handling in editing host