fixed showing the most recent valid user query to the history