Putting the monkey patch in an onload handler