updated controller and model