added shutdown stuffs