update functions.js