Fixed shutdown problem