fix if the input json format is invalid