upd js code