fixed some document.write
just a fast ideas