fix order of setting query results