changes in model.rb and controller.rb