removed doc.write from adapter