fixed saving of custom fields