serialize_with_custom_script