fixes another bug while reconstructing the program from json (special case for repeat)