Script works as intended