Properly setting shutdown event.