Added changes to the controller and template