make sure cli close down correctly