Modify the error handling if json query fails