removed obsolete client code from HostState
fixed program flow not reaching end of main in order to call cleanup code at the right place
fixed mergeconflict