added broadcasting of messages and typing events