prepare to work on query