declare index as local var

Heh Constantin,
here is another global local var.

Cheers