fix reading the queries