Added JS functions