Fix unexpected shutDown