javascript structure update