Add init function to controller.