Made chat client more robust