Fix 'json.parse is undefined' error