added chat infrastructure