replaced direct access to field['unique'] with a getter