make script more resilient when TFL return malformed JSON