Fixes save error, still a problem with the loop

i really am not sure what is going on
next time: try a for in instead of the for loop on line 22