cleanup the controller