added methods to the controller and fixed a view