You’re right, and I was aware of that.
The problem is that I haven’t been able to find a way to check if the PH layer was previously enabled or not using the SDK.
I’m looking for a solution and will update the script as soon as I find one.
Thanks for your comment!