document load event fix