Move onFrameLoad function call to end of load function