Fix error in function.js