improving shutdown