update javascript object