For some reason window.onload was not running