Fixed unset variable error, add write_announcement table