i wasn't overwriting the file so the left over stuff was there which looked like garbage and was confusing