modified batch_controller.rb from engine