modified controller.rb