updated model  and controller