Modified the update chat to use snprintf