Corrected event listener

window with event listener "load" waits for all content to be loaded
instead of event listener "DOMContentloaded", which waits only for the
document to be loaded.