Corrected for loop

Using for-in loop causes problems with IE8 and jquery 1.7