fixing function.js file