Attaching event to window onload, fix #8