updated model and controller