modified queries to ensure collections are ordered