modifying controllers.js for fixing a bug