I guess you have to listen for shutdown in case if UI does not respond or does not have that thing implemented