update js code