Added chat client-side code