replaced document.write with document.getElementById