model and controller fixes