add query histroy