updating MainController class