fixing instance cases 2 and 4 to wait for onload before grabbing node