fix bug in while loop, still need to figure out how getattr works on a file that DNE