Chat history is saving to database