modify and add js functions