fix issue with JSON parsing objects/arrays "1}" or "1]"