clean up before leaving