Updated code to broadcast to all client n update output in messages div.