new query and query handler