Fixed Chat issues
Refactored Chat