Catch the JSON undefined error