adding support for queries with mutiple ids