update js variable