Fixed shutdown error