fixed issue with file writer