I don't see anything wrong with the script.

@Puezzin, did you manage to find out what is wrong?