Hacked solution

Sorry for reporting this bug to you, it is totally independent from your script.