fixing chat bug on tab switch