Update Javascript code