cleanup before sending over