One of the "if" statements in the original script had an upper-case "i" ...

"If" rather than "if"


jm