Comment out document.write funtion to make listener work