fix auto shutdown bug