add method to controller and fixed test