I suggest a new approach: maybe make a JSONArray first (before the for-loop) and add new0 in the for-loop to it?
Chrisir