Created function in controllers.js and set value of name.