Fixed a bug where each an error message was forcing an attempt at creating each JSON file multiple times.