fix shutdown