Adding history tracking of queries