fix custom field adding with apply function