JS functions update