change wri to doc.writeln