preparing graceful kill