add ability to shutdown client