Added type field to query