improve chat example; add server sent message