Update app/controllers/message_controller.rb

Add safety persistence code block