new controller and some logic