don't make functions within a loop; I mistake the file to fix