corrected error in for-cycle