Ensuring a clean leave