Add a string check in front of json.decode