fixed issue in for-in loop using 'of'