[EH] write programm.json only when necessary