added chat existence check