moved JSONObject and JSONoutput around. STILL writes too OFTEN. Sees 1st rec but not 2nd rec problem.