Corrected custom field code snippet