modified post controller and model