fix shutdown error