added indexController.js logic