fixed chat client emit functionality