Adding configuration of script object controls the lifecycle of native object.