full program shutdown bug fix