added missing var in js that was causing script error