modified init for filewriter