Fixing variable error (script runs correctly, now)