cleanup on upload helper