update javasript functions