added chat code