bug while detecting chat and chatStates fixed