fixing update method in controller