Clean up before submission