updating js code