Added dom update code