fixed writeReadableFile()