Update chat logic