Added shutdown control.