fixed BATCH process to generate valid JSON content