temp may not be loaded, we need to put this into a onload event