randomize number of queries and fixes