fix bug in readQueries