Fix a shutDown bug