fix functions.js