Fixed the for-in loop