error catching for bad json