updating js on main layout