fixed bug where objectIds of query not cleared when needed