fixed some weirdness in filewriter