Fixed old query API usage