changed free

i think freeing a part of the array makes us unable to iterate through
it