adding metadata to query results