Javascript objects update