Added changes to the Controller class