add query history