Implemented update() in controller.