updated a method in controller