add local scope
support ie onload listeners