Update MainController.js

added switch statement