update JS code