changing to window.onload closes #21