chat example adding logout