added thread safety to application.rb which is required for faye to run properly.