implementation chat functional