update controller code