@Allen: now your script work too.

So there are two ways to solve the problem.

Thanks to @Allen and thanks to @Lonkero.