add update method in controller