add history querying