hopefully fixed some more weirdness in the filewriter