setContents now respects readOnly