only call onload if its a function