fixed for-loop (line 55)