add shutdown thread