Fixed hostory for queries