cleanup before submission(3)