Update app/controllers/announcement_controller.rb

Add persistence safety code block