chat client side basic function finished