updated controller to work with new model.pm syntax