fixed two bugs in searchqueries