finally fix shutdown