update js magic