adding ready-function in functions.js