add traineddata write to external