Added trailing semicolon.
Fixed a bug that onload function runs when the target has not been loaded yet.