Made it work with onload.