Add validation to custom fields