fix functionality chat