correct error on function.js