fixed save_custom_fields method