fixes #2125 - problem with custom field code in event structure.