Fix broken controller code