Update helpers.rb

fix bug where main_app was not used in the right place