serialize custom fields