fix double qoutes, and move JSON object outside loop