More Errors rectified in controller.js