frame of the chat function done