changed methods in controller to support several views