fix shutdown problem