save history file. close #88
set conditions in queries, close #87