add querying by tag, flatten to array