Fixed unsafe for loop
removed debug