proccess queries