fixed bug in main.controller.js