improve shutdown phase