added js fuction