Bugfix: adding handlers outside of before window.onload