fix saving custom_flags