fix bug of query