Improve shut down