fixed a bug when generating several json files and a single one at the same time