Fixing chat history issue