missed a json object decrement at end of loop