Updated script of controller.