shutdown bug fix