function.js fixed