JSON object update after javascript object update